﻿namespace CSharpPro._0923;

public class Dome
{
    //作业1：判断闰年
    public static bool IsLeapYear(int year)
    {
        return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
    }
    //作业2：旅游价格计算
    public static double CalculateTravelPrice(int month, int transport)
    {
        const double originalPrice = 8800; // 原价
        double discountRate = 0;
        if (month >= 5 && month <= 10)
        {
            // 旺季逻辑
            discountRate = transport == 1 ? 0.9 : 0.75;
        }
        else
        {
            // 淡季逻辑
            discountRate = transport == 1 ? 0.6 : 0.3;
        }

        return originalPrice * discountRate;
    }
}
    
  
